feat: Open Pseudo-tabs for the currently opened page#12
Conversation
* Incorrect version of npm though
* Had to hardcode some margin/padding values to work around Navbar
micahdbak
left a comment
There was a problem hiding this comment.
I'm happy to merge these changes if you're happy with them, David! I'm going to start a new PR using React Router's HashRouter
| @@ -0,0 +1 @@ | |||
| use flake . | |||
|
|
||
| import pythonIcon from '../images/python.png'; | ||
|
|
||
| export const TabBar = ({ view }) => { |
There was a problem hiding this comment.
I'm happy with this implementation; thanks!
There was a problem hiding this comment.
Assuming I use HashRouter as I commented in the related issue, maybe "view" can be renamed to "filename". Then it can be up to the router to describe what is put in the TabBar.
| setView(searchParams.get('view')); | ||
| } | ||
| }, []); | ||
| const searchParams = new URLSearchParams(window.location.search); |
There was a problem hiding this comment.
I'll update this stuff in a new PR for using the HashRouter, but thanks for looking into why it sucks 😎
|
Hi David, I've merged a hash routing feature - could you test that it resolves your concerns? I've put routing under src/index.js, and I think you can use the useLocation hook from react-router-dom to display the current location in the tabs. Also, could you rename this component from 'TabsBar' to 'NavTabs' or 'NavTabsBar'? I'm going with a 'NavX' naming convention for all navigation components. |
Resolves #8. I've got a minimally working example working right now. This is what it looks like:
Wide screen layout
Small screen layout